<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title;?></title>
<link href="<?php echo base_url()?>css/sites/home.css" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url()?>css/sites/list.css" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url()?>css/sites/PubNews.css" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url()?>css/sites/featuredcontentglider.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo base_url()?>js/sites/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>js/sites/post.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>tiny_mce/tiny_mce.js"></script>

<script type="text/javascript">
	function edittext(id)
	{
		 tinyMCE.init({
				// General options
				mode : "exact",
				elements : id,
				theme : "advanced",
				width: "100%",
				height: "400px",
				skin : "o2k7",
				plugins : "markettoimages,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
				// Theme options					
				theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
				theme_advanced_buttons2 : "search,|,bullist,numlist,|,undo,redo,|,link,unlink,|,insertdate,inserttime,preview,|,forecolor,backcolor,markettoimages",					
				theme_advanced_buttons3 : "",
				theme_advanced_buttons4 : "",
				theme_advanced_toolbar_location : "top",
				theme_advanced_toolbar_align : "left",
				theme_advanced_statusbar_location : "bottom",
		//		theme_advanced_resizing : true,

				// Example content CSS (should be your site CSS)
				//content_css : "css/content.css",
				 
				// Drop lists for link/image/media/template dialogs
				template_external_list_url : "lists/template_list.js",
				external_link_list_url : "lists/link_list.js",
				external_image_list_url : "lists/image_list.js",
					media_external_list_url : "lists/media_list.js"			
			}); 
	}
	edittext('txtcontent');
</script>

</head>

<body>
	<div class="wraper">
		<!--__________________________________________Start.header-->
		<div class="header">
			<?php echo $this->load->view('sites/header/header_top');?>
			
			<div class="header_main">
				<?php echo $this->load->view('sites/header/header_main');?>				
			</div><!--End.header_main-->
			<div class="clear"></div>
		</div><!--End.header-->
		
		<!--__________________________________________Start.nav_menu-->
		<div class="nav_menu">
			<?php echo $this->load->view('sites/menu/main_menu');?>
		</div><!--End.nav_menu-->
		
		<!--__________________________________________Start.middle-->
		<div class="middle">
			<div class="adv1" style="float: left; width: 49%; height:60px; border: 1px solid #CCC; padding: 1px;">
				<a href="#"><img src="<?php echo base_url()?>images/sites/Adv1.png" width="480" height="60" /></a> 
			</div><!--End.adv1-->
			<div class="adv1" style="float: right; width: 49%; height: 60px; border: 1px solid #CCC; padding: 1px;">
				<a href="#"><img src="<?php echo base_url()?>images/sites/Adv1.png" width="480" height="60" /></a> 
			</div><!--End.adv1-->
			<div class="clear"></div>
			
			<?php
				$categories		= $this->mod_lib->load_all('categories', '', array('status'=>1, 'level'=>1, 'order !='=>""), '', '', array('order'=>'ASC'));
				$province		= $this->mod_lib->load_all('provinces', '', array('status'=>1), '', '', array());
			?>
			<div class="col_720" style="width: 980px;">
				<form action="" name="frmpost" id="frmpost" method="post" onsubmit="return checkfrmpost();" enctype="multipart/form-data">
					<div class="pubnews" style="width: auto;">		        			
	        			<h1 style="background-color: #0E5FB2;font-family: Tahoma,Verdana,Arial;padding: 2px 4px 3px 10px;font-size:12px; color: #FFF;" class="Header">Đăng tin rao vặt</h1>
	        			<input type="hidden" name="base_url" id="base_url" value="<?php echo base_url()?>" />
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
					  		<?php if (empty($_SESSION[base_url().'user_email']) && !isset($_SESSION[base_url().'user_email'])){?>
					  		<tr>
					    		<td colspan="3" align="center"><span style="color: red; font-size: 14px;">Nếu bạn không đăng nhập tin này sẽ hiển thị khách vãng lai</span></td>				        		
				      		</tr>
				      		<?php }?>
					  		<tr>
					    		<td width="28%">Tiêu đề *</td>
					    		<td>
				        			<input class="textbox" type="text" name="txttitle" id="txttitle" size="60" />				        			
				        		</td>
				        		<td><span style="color: red; display: none;" id="error_title">Vui lòng nhập tiêu đề</span></td>
				      		</tr>
					  		<tr>
					    		<td>Điện thoại *</td>
					    		<td>
					    			<input class="textbox" type="text" name="txtphone" id="txtphone" size="40" />
					    		</td>
					    		<td><span style="color: red; display: none;" id="error_phone">Vui lòng nhập số điện thoại</span></td>		    		
				      		</tr>
				      		<tr>
					    		<td>Chọn ảnh</td>
					    		<td>
					    			<input class="textbox" type="file" name="txtimage" id="txtimage" size="40" />
					    		</td>		 
					    		<td>
					    			<span style="color: red; display: none;" id="error_image">Chỉ chấp nhận ảnh *.gift, *.png, *.jpg, *.jpeg <br />Dung lượng ảnh &lt; 1MB</span>
					    			<span style="display: none;" id="view_image"></span>
					    		</td>   		
				      		</tr>
				  			<tr>
					    		<td>Chuyên mục</td>
					    		<td>
					    			<select class="textbox_p100" name="select_cat1" id="select_cat1" style="width: 262px; border: 1px solid #CCC; height: 22px;" onchange="GetSubCat();">
			            				<option value="">==== Chọn chuyên mục ======</option>
			            				<?php foreach ($categories as $c1){?>
			            					<option value="<?php echo $c1['id']?>"><?php echo ucfirst(mb_strtolower(mb_convert_case($c1['name'], MB_CASE_TITLE, 'UTF-8'), 'UTF-8'))?></option>
			            				<?php }?>            				
				        			</select>
				        		</td>
				        		<td><span style="color: red; display: none;" id="error_cat">Vui lòng chọn chuyên mục</span></td>
				      		</tr>
				      		<tr>
					    		<td>Nhu cầu</td>
					    		<td>
					    			<select class="textbox_p100" name="select_subcat" id="select_subcat" style="width: 262px; border: 1px solid #CCC; height: 22px;" disabled="disabled" onchange="GetSubSubCat();">
			            				<option value="">==== Chọn nhu cầu ==========</option>		            				            			
				        			</select>
				        		</td>
				        		<td><span style="color: red; display: none;" id="error_subcat">Vui lòng chọn nhu cầu</span></td>
				      		</tr>
				      		<tr>
					    		<td>Chủng loại</td>
					    		<td colspan="2">
					    			<select class="textbox_p100" name="select_subsubcat" id="select_subsubcat" style="width: 262px; border: 1px solid #CCC; height: 22px;" disabled="disabled">
			            				<option value="">==== Chọn chủng loại ========</option>		            				            			
				        			</select>
				        		</td>
				      		</tr>
				      		<tr>
					    		<td>Giá</td>
					    		<td colspan="2">
					    			<select class="textbox_p100" name="select_price" id="select_price" style="width: 262px; border: 1px solid #CCC; height: 22px;" disabled="disabled">
			            				<option value="">==== Chọn giá chuyên mục ===</option>		            				            			
				        			</select>
				        		</td>
				      		</tr>
				      		<tr>
					    		<td>Nơi rao</td>
					    		<td>
					    			<select class="textbox_p100" name="select_city" id="select_city" style="width: 262px; border: 1px solid #CCC; height: 22px;" onchange="GetDistinct();">
			            				<option value="">==== Chọn nơi rao ==========</option>
			            				<?php foreach ($province as $row_prov){?>
			            					<option value="<?php echo $row_prov['id']?>"><?php echo $row_prov['name']?></option>
			            				<?php }?>		            				            			
				        			</select>
				        		</td>
				        		<td><span style="color: red; display: none;" id="error_city">Vui lòng chọn nơi rao</span></td>
				      		</tr>
				      		<tr>
					    		<td>Quận/huyện</td>
					    		<td colspan="2">
					    			<select class="textbox_p100" name="select_distinct" id="select_distinct" style="width: 262px; border: 1px solid #CCC; height: 22px;" disabled="disabled">
			            				<option value="">==== Chọn Quận/huyện ======</option>		            				            			
				        			</select>
				        		</td>
				      		</tr>
					  		<tr>
					    		<td>Nội dung đăng *</td>
					    		<td colspan="2">
				        			<textarea class="textbox_p100" name="txtcontent" id="txtcontent" cols="45" rows="5"></textarea>
				        		</td>
				        	</tr>
				        	<tr>
					    		<td></td>
					    		<td colspan="2">
				        			<span style="color: red; display: none;" id="error_content">Vui lòng nhập nội dung tin rao</span>
				        		</td>
				        	</tr>	        		      				  
						</table>        
	        	
			        	<p>
			        		<div style="float: left;">
			        			<input class="" type="checkbox" name="chkaccept" id="chkaccept" />
			        			Tôi chấp nhận những <a href="">điều khoản của RaoAZ247.com</a>
			        		</div>
			        		<div style="float: left; padding-left: 50px;">
			        			<input type="submit" class="butt_dangtin" name="cmdpost" id="cmdpost" value="Đăng tin" style="border: none; cursor: pointer;" disabled="disabled" />								
							</div>
						</p>
						<div class="clear"></div>								                
					</div>
				</form>
				<div class="clear"></div>
				<!--ENd. published news-->
			</div>
	
	<!--==================================End.col_720-->
	<div class="clear"></div>
	
	<?php if (!empty($categories)){?>
	<div class="col_720" style="width: 980px; border: 1px solid #EFEFEF; margin-top: 10px; height: 100px;">
		<ul class="clscat">
			<?php foreach ($categories as $row_cat){?>
			<li class="clslist">
				<a href="" class="clslist_a"><?php echo ucfirst(mb_strtolower($row_cat['name'], 'UTF-8'));?></a>
			</li>
			<?php }?>			
		</ul>
	</div>
	<?php }?>
	<div class="clear"></div>
	<!--__________________________________________Star.footer-->
	
	<div class="col_720" style="width: 980px; border: 1px solid #EFEFEF; margin-top: 10px; float: left;">
		<ul class="clscat" style="margin: 5px;">
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
			<li class="city">
				<a href="">Hà nội</a>
			</li>
		</ul>
	</div>
	<div class="clear"></div>
	
	<div class="footer">
	
	<div class="menu_footer">
		<div class="col_980">
	    	<img src="<?php echo base_url()?>images/sites/Home_icon2.png" width="20" height="16" />
	        <a href="#">Trang chủ</a>|
	        <a href="#">Việc làm</a>|
	        <a href="#">Tuyển sinh - đào tạo</a>|
	        <a href="#">Bất động sản</a>|
	        <a href="#">Ô tô</a>|
	        <a href="#">Xe máy</a>|
	        <a href="#">Điện tử - Điện máy</a>|
	        <a href="#">Đồ dùng - Mặt hàng khác</a>|
	        <a href="#">Tìm đối tác</a>|
	        <a href="#">Dịch vụ</a>|
	        <a href="#">Cộng đồng</a>
	        
	        <a class="gotop" href="#gotop">
	        	<img src="<?php echo base_url()?>images/sites/icon_gotop.png" width="19" height="19" />
	        </a>
	    </div>
	</div>
	<div class="clear"></div>
	
	<div class="cop_footer">
		<div class="col_980">
	    	<div class="reg_link">
		        <a href="http://dangkywebsite.gov.vn/vn/index.html" target="_blank">
		        	<img src="<?php echo base_url()?>images/sites/dadangky.png" width="96" height="62" />
		        </a>
	        </div>
	        
	        <div class="cop_site">
	        	Copyright © 2012 raovatABC.com. All rights reserved.<br />
				Giấy phép hoạt động số: 196/GP-BC do Bộ VHTT cấp 20/10/2012.<br />
				RaovatABC.com có trách nhiệm chuyển tải thông tin. Không chịu bất kỳ trách nhiệm nào từ các tin này. <a href="#">Xem chi tiết</a>
	        </div>
	        <div class="clear"></div>
	        
	        <div class="info_site">Design by <a href="ymsgr:sendim?tienduc295">tienducdesign@gmail.com</a> - Developer by <a href="ymsgr:sendim?duitnuce86">duitnuce86</a>.
	        </div>
	    </div>
	</div>
	
	</div><!--End.footer-->

</div><!--End.wraper-->

</body>
</html>